import edu.linyh.night.WordUtil;
import org.junit.Test;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author Linyh
 * @Description
 * @Date 2022/7/4 20:50
 **/

public class test {
    @Test
    public void test02() throws IOException {
        String path="E:\\小学期\\primary-school\\Day1\\src\\main\\resources\\";
        String fileName="E:\\小学期\\primary-school\\Day1\\src\\main\\resources\\测试.doc";
        String templateName="freeMarker.ftl";
        String templatePath="E:\\小学期\\primary-school\\Day1\\src\\main\\resources\\";
        Map<String,Object> map=new HashMap<>();
        map.put("name","林宇航");
        map.put("age",20);
        map.put("stuNum","194031516");
        try {
            WordUtil.generateWord(map,fileName,templateName,templatePath);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("出现异常");
        }
        System.out.println("生成成功");
    }
}
